﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace PenguinLevelEditor
{
    public class MouseInput
    {

        public MouseInput()
        {
        }

        public void Update(GameTime gameTime)
        {
            m_currentState = Mouse.GetState();

            m_leftButtonPressed = false;
            m_middleButtonPressed = false;
            m_rightButtonPressed = false;

            if (m_currentState.LeftButton == ButtonState.Pressed)
            {
                m_leftButtonPressed = true;
            }
            if (m_currentState.RightButton == ButtonState.Pressed && m_previousState.RightButton == ButtonState.Released)
            {
                m_rightButtonPressed = true;
            }
            if (m_currentState.MiddleButton == ButtonState.Pressed)
            {
                m_middleButtonPressed = true;
            }
        }

        public void Draw(GameTime gameTime)
        {

        }

        public void CompleteUpdate()
        {
            m_previousState = m_currentState;
        }


        public MouseState m_currentState;
        public MouseState m_previousState;

        public bool m_leftButtonPressed;
        public bool m_rightButtonPressed;
        public bool m_middleButtonPressed;

    }
}
